package edu.gmu.atelier.generic;

import edu.gmu.atelier.ComplexElement;
import edu.gmu.atelier.generic.ComplexVector;
import edu.gmu.atelier.generic.AbstractMatrix;

/**
 * Set of vectors with vector combination and scalar multiplication operations.
 * @author James H. Pope
 */
public class ComplexVectorFactory
{
    //------------------------------------------------------------------------//
    // Factory methods
    //------------------------------------------------------------------------//
    
    /**
     * Makes a new matrix from data array in row-major order.
     * @param data
     * @return 
     */
    public static AbstractMatrix<ComplexVector> makeFromRows(double[][] data)
    {
        ComplexVector[] b = new ComplexVector[data[0].length];
        for (int c = 0; c < b.length; c++)
        {
            ComplexElement[] comps = new ComplexElement[data.length];
            for (int r = 0; r < comps.length; r++)
            {
                // FOR NOW IMAG ALWAYS ZERO
                comps[r] = new ComplexElement( data[r][c], 0.0 );
            }
            b[c] = new ComplexVector(comps);
        }
        return new AbstractMatrix<ComplexVector>( b );
    }
    
//    public static AbstractMatrix<ComplexVector> makeIdentity(int n)
//    {
//        RealVector[] b = new RealVector[n];
//        for (int c = 0; c < b.length; c++)
//        {
//            double[] v = new double[n];
//            v[c] = 1.0;
//            b[c] = new RealVector(v);
//        }
//        return new AbstractMatrix<RealVector>( b );
//    }

}
